home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-26 | 23.9 KB | 755 lines | [TEXT/EMAC] |
- ;;;
- ;;; This file is part of a Macintosh port of GNU Emacs.
- ;;; Copyright (C) 1993 Marc Parmet. All rights reserved.
- ;;;
-
- ;;;
- ;;; Header file for Macintosh traps
- ;;;
- ;;; This file is included by site-init.el, so that this file is part of
- ;;; the dump and available at startup. If you hack it, you can make
- ;;; your changes part of the dump by once launching Emacs and holding
- ;;; down the option key.
- ;;;
-
- ;;;
- ;;; File system errors
- ;;;
-
- (defconst noErr 0 "no error")
- (defconst nsvErr -35 "no such volume")
- (defconst fnfErr -43 "file not found")
-
- ;;;
- ;;; *** From EPPC.h
- ;;;
-
- (defconst receiverIDMask 61440 "0x0000F000")
- (defconst receiverIDisPSN 32768 "0x00008000")
- (defconst receiverIDisSignature 28672 "0x00007000")
- (defconst receiverIDisSessionID 24576 "0x00006000")
- (defconst receiverIDisTargetID 20480 "0x00005000")
-
- (defconst systemOptionsMask 3840 "0x00000F00")
- (defconst nReturnReceipt 512 "0x00000200")
-
- (defconst priorityMask 255 "0x000000FF")
- (defconst nAttnMsg 1 "0x00000001")
-
- (defconst bufferIsSmall -607)
- (defconst noOutstandingHLE -608)
- (defconst connectionInvalid -609 "nonexistent target or session ID")
- (defconst noUserInteractionAllowed -610)
-
- ;;;
- ;;; *** From AppleEvents.h ***
- ;;;
-
- ;;; Apple event descriptor types
- (defconst typeBoolean "bool")
- (defconst typeChar "TEXT")
- (defconst typeSMInt "shor")
- (defconst typeInteger "long")
- (defconst typeSMFloat "sing")
- (defconst typeFloat "doub")
- (defconst typeLongInteger "long")
- (defconst typeShortInteger "shor")
- (defconst typeLongFloat "doub")
- (defconst typeShortFloat "sing")
- (defconst typeExtended "exte")
- (defconst typeComp "comp")
- (defconst typeMagnitude "magn")
- (defconst typeAEList "list")
- (defconst typeAERecord "reco")
- (defconst typeTrue "true")
- (defconst typeFalse "fals")
- (defconst typeAlias "alis")
- (defconst typeEnumerated "enum")
- (defconst typeType "type")
- (defconst typeAppParameters "appa")
- (defconst typeProperty "prop")
- (defconst typeFSS "fss ")
- (defconst typeKeyword "keyw")
- (defconst typeSectionH "sect")
- (defconst typeWildCard "****")
- (defconst typeApplSignature "sign")
- (defconst typeSessionID "ssid")
- (defconst typeTargetID "targ")
- (defconst typeProcessSerialNumber "psn ")
- (defconst typeNull "null")
-
- ;;; Keywords for Apple event parameters
- (defconst keyDirectObject "----")
- (defconst keyErrorNumber "errn")
- (defconst keyErrorString "errs")
- (defconst keyProcessSerialNumber "psn ")
-
- ;;; Keywords for Apple event attributes
- (defconst keyTransactionIDAttr "tran")
- (defconst keyReturnIDAttr "rtid")
- (defconst keyEventClassAttr "evcl")
- (defconst keyEventIDAttr "evid")
- (defconst keyAddressAttr "addr")
- (defconst keyOptionalKeywordAttr "optk")
- (defconst keyTimeoutAttr "timo")
- (defconst keyInteractLevelAttr "inte")
- (defconst keyEventSourceAttr "esrc")
- (defconst keyMissedKeywordAttr "miss")
-
- ;;; Keywords for special handlers
- (defconst keyPreDispatch "phac")
- (defconst keySelectProc "selh")
-
- ;;; Event class
- (defconst kCoreEventClass "aevt")
-
- ;;; Event ID's
- (defconst kAEOpenApplication "oapp")
- (defconst kAEOpenDocuments "odoc")
- (defconst kAEPrintDocuments "pdoc")
- (defconst kAEQuitApplication "quit")
- (defconst kAEAnswer "ansr")
- (defconst kAEApplicationDied "obit")
- (defconst kAECreatorType "crea")
- (defconst kAEQuitAll "quia")
- (defconst kAEShutDown "shut")
- (defconst kAERestart "rest")
-
- ;;; Constants for setting the sendMode parameter of AESend and for
- ;;; the KeyInteractiveLevel attribute
- (defconst kAENoReply 1)
- (defconst kAEQueueReply 2)
- (defconst kAEWaitReply 3)
- (defconst kAENeverInteract 16)
- (defconst kAECanInteract 32)
- (defconst kAEAlwaysInteract 48)
- (defconst kAECanSwitchLayer 64)
- (defconst kAEDontReconnect 128)
- (defconst kAEWantReceipt nReturnReceipt)
-
- ;;; Constants for the sendPriority parameter of AESend
- (defconst kAENormalPriority 0)
- (defconst kAEHighPriority nAttnMsg)
-
- ;;; Constant for the returnID parameter of AECreateAppleEvent
- (defconst kAutoGenerateReturnID -1)
-
- ;;; Constant for transaction ID's
- (defconst kAnyTransactionID 0)
-
- ;;; Constants for timeout durations
- (defconst kAEDefaultTimeout -1)
- (defconst kNoTimeOut -2)
-
- ;;; Constants for the dispatcher parameter of AEResumeTheCurrentEvent
- (defconst kAENoDispatch 0)
- (defconst kAEUseStandardDispatch -1)
-
- ;;; Error messages in response to reading and writing event contents
- (defconst errAECoercionFail -1700)
- (defconst errAEDescNotFound -1701 "descriptor record not found")
- (defconst errAECorruptData -1702)
- (defconst errAEWrongDataType -1703)
- (defconst errAENotAEDesc -1704)
- (defconst errAEBadListItem -1705)
- (defconst errAENewerVersion -1706)
- (defconst errAENotAppleEvent -1707)
- (defconst errAEEventNotHandled -1708 "event not handled")
- (defconst errAEReplyNotValid -1709)
- (defconst errAEUnknownSendMode -1710)
- (defconst errAEWaitCanceled -1711)
- (defconst errAETimeout -1712)
- (defconst errAENoUserInteraction -1713 "no user interaction allowed")
- (defconst errAENotASpecialFunction -1714)
- (defconst errAEParamMissed -1715)
- (defconst errAEUnknownAddressType -1716)
- (defconst errAEHandlerNotFound -1717)
- (defconst errAEReplyNotArrived -1718)
- (defconst errAEIllegalIndex -1719)
-
- ;;;
- ;;; *** From AERegistry.h ***
- ;;;
-
- (defconst cAEList "list")
- (defconst cApplication "capp")
- (defconst cArc "carc")
- (defconst cBoolean "bool")
- (defconst cCell "ccel")
- (defconst cChar "cha ")
- (defconst cColorTable "clrt")
- (defconst cColumn "ccol")
- (defconst cDocument "docu")
- (defconst cDrawingArea "cdrw")
- (defconst cEnumeration "enum")
- (defconst cFile "file")
- (defconst cFixed "fixd")
- (defconst cGraphicLine "glin")
- (defconst cGraphicObject "cgob")
- (defconst cGraphicShape "cgsh")
- (defconst cGraphicText "cgtx")
- (defconst cGroupedGraphic "cpic")
- (defconst cInsertionLoc "insl")
- (defconst cIntlText "itxt")
- (defconst cIntlWritingCode "intl")
- (defconst cItem "citm")
- (defconst cLine "clin")
- (defconst cLongInteger "long")
- (defconst cMenu "cmnu")
- (defconst cMenuItem "cmen")
- (defconst cObject "cobj")
- (defconst cObjectSpecifier "obj ")
- (defconst cOpenableObject "coob")
- (defconst cOval "covl")
- (defconst cParagraph "cpar")
- (defconst cPixel "cpxl")
- (defconst cPixelMap "cpix")
- (defconst cPolygon "cpgn")
- (defconst cQDPoint "QDpt")
- (defconst cQDRectangle "qdrt")
- (defconst cRectangle "crec")
- (defconst cRGBColor "cRGB")
- (defconst cRotation "trot")
- (defconst cRoundedRectangle "crrc")
- (defconst cRow "crow")
- (defconst cSelection "csel")
- (defconst cShortInteger "shor")
- (defconst cTable "ctbl")
- (defconst cText "ctxt")
- (defconst cTextFlow "cflo")
- (defconst cTextStyles "tsty")
- (defconst cType "type")
- (defconst cWindow "cwin")
- (defconst cWord "cwor")
- (defconst errAEBadKeyForm -10002)
- (defconst errAECantHandleClass -10010)
- (defconst errAECantSupplyType -10009)
- (defconst errAEEventFailed -10000)
- (defconst errAEIndexTooLarge -10007)
- (defconst errAEInTransaction -10011)
- (defconst errAELocalOnly -10016)
- (defconst errAENoSuchTransaction -10012)
- (defconst errAENotAnElement -10008)
- (defconst errAENotASingleObject -10014)
- (defconst errAENotModifiable -10003)
- (defconst errAENoUserSelection -10013)
- (defconst errAEPrivilegeError -10004)
- (defconst errAEReadDenied -10005)
- (defconst errAETypeError -10001)
- (defconst errAEWriteDenied -10006)
- (defconst kAEAbout "abou")
- (defconst kAEAfter "afte")
- (defconst kAEAliasSelection "sali")
- (defconst kAEAllCaps "alcp")
- (defconst kAEArrowAtEnd "aren")
- (defconst kAEArrowAtStart "arst")
- (defconst kAEArrowBothEnds "arbo")
- (defconst kAEAsk "ask ")
- (defconst kAEBefore "befo")
- (defconst kAEBeginning "bgng")
- (defconst kAEBeginsWith "bgwt")
- (defconst kAEBeginTransaction "begi")
- (defconst kAEBold "bold")
- (defconst kAECaseSensEquals "cseq")
- (defconst kAECentered "cent")
- (defconst kAEChangeView "view")
- (defconst kAEClone "clon")
- (defconst kAEClose "clos")
- (defconst kAECondensed "cond")
- (defconst kAEContains "cont")
- (defconst kAECopy "copy")
- (defconst kAECoreSuite "core")
- (defconst kAECountElements "cnte")
- (defconst kAECreateElement "crel")
- (defconst kAECreatePublisher "cpub")
- (defconst kAECut "cut ")
- (defconst kAEDelete "delo")
- (defconst kAEDoObjectsExist "doex")
- (defconst kAEDoScript "dosc")
- (defconst kAEDrag "drag")
- (defconst kAEDuplicateSelection "sdup")
- (defconst kAEEditGraphic "edit")
- (defconst kAEEmptyTrash "empt")
- (defconst kAEEnd "end ")
- (defconst kAEEndsWith "ends")
- (defconst kAEEndTransaction "endt")
- (defconst kAEEquals "= ")
- (defconst kAEExpanded "pexp")
- (defconst kAEFast "fast")
- (defconst kAEFinderEvents "FNDR")
- (defconst kAEFormulaProtect "fpro")
- (defconst kAEFullyJustified "full")
- (defconst kAEGetClassInfo "qobj")
- (defconst kAEGetData "getd")
- (defconst kAEGetDataSize "dsiz")
- (defconst kAEGetEventInfo "gtei")
- (defconst kAEGetInfoSelection "sinf")
- (defconst kAEGetPrivilegeSelection "sprv")
- (defconst kAEGreaterThan "> ")
- (defconst kAEGreaterThanEquals ">= ")
- (defconst kAEGrow "grow")
- (defconst kAEHidden "hidn")
- (defconst kAEHiQuality "hiqu")
- (defconst kAEImageGraphic "imgr")
- (defconst kAEInfo 11)
- (defconst kAEIsUniform "isun")
- (defconst kAEItalic "ital")
- (defconst kAELeftJustified "left")
- (defconst kAELessThan "< ")
- (defconst kAELessThanEquals "<= ")
- (defconst kAELowercase "lowc")
- (defconst kAEMain 0)
- (defconst kAEMakeObjectsVisible "mvis")
- (defconst kAEMiscStandards "misc")
- (defconst kAEModifiable "modf")
- (defconst kAEMove "move")
- (defconst kAENo "no ")
- (defconst kAENoArrow "arno")
- (defconst kAENonmodifiable "nmod")
- (defconst kAEOpen "odoc")
- (defconst kAEOpenSelection "sope")
- (defconst kAEOutline "outl")
- (defconst kAEPageSetup "pgsu")
- (defconst kAEPaste "past")
- (defconst kAEPlain "plan")
- (defconst kAEPrint "pdoc")
- (defconst kAEPrintSelection "spri")
- (defconst kAEPrintWindow "pwin")
- (defconst kAEPutAwaySelection "sput")
- (defconst kAEQDAddOver "addo")
- (defconst kAEQDAddPin "addp")
- (defconst kAEQDAdMax "admx")
- (defconst kAEQDAdMin "admn")
- (defconst kAEQDBic "bic ")
- (defconst kAEQDBlend "blnd")
- (defconst kAEQDCopy "cpy ")
- (defconst kAEQDNotBic "nbic")
- (defconst kAEQDNotCopy "ncpy")
- (defconst kAEQDNotOr "ntor")
- (defconst kAEQDNotXor "nxor")
- (defconst kAEQDOr "or ")
- (defconst kAEQDSubOver "subo")
- (defconst kAEQDSubPin "subp")
- (defconst kAEQDXor "xor ")
- (defconst kAERedo "redo")
- (defconst kAERegular "regl")
- (defconst kAEReplace "rplc")
- (defconst kAERevealSelection "srev")
- (defconst kAERevert "rvrt")
- (defconst kAERightJustified "rght")
- (defconst kAESave "save")
- (defconst kAESetData "setd")
- (defconst kAESetPosition "posn")
- (defconst kAEShadow "shad")
- (defconst kAESharing 13)
- (defconst kAEShowClipboard "shcl")
- (defconst kAESleep "slep")
- (defconst kAESmallCaps "smcp")
- (defconst kAEStrikethrough "strk")
- (defconst kAESubscript "sbsc")
- (defconst kAESuperscript "spsc")
- (defconst kAETransactionTerminated "ttrm")
- (defconst kAEUnderline "undl")
- (defconst kAEUndo "undo")
- (defconst kAEWholeWordEquals "wweq")
- (defconst kAEYes "yes ")
- (defconst kAEZoom "zoom")
- (defconst kByCommentView 6)
- (defconst kByDateView 3)
- (defconst kByIconView 1)
- (defconst kByKindView 5)
- (defconst kByLabelView 7)
- (defconst kByNameView 2)
- (defconst kBySizeView 4)
- (defconst kBySmallIcon 0)
- (defconst kByVersionView 8)
- (defconst keyAEAngle "kang")
- (defconst keyAEArcAngle "kend")
- (defconst keyAEBaseAddr "badd")
- (defconst keyAEBgndColor "kbcl")
- (defconst keyAEBgndPattern "kbpt")
- (defconst keyAEBounds "kbnd")
- (defconst keyAECellList "kclt")
- (defconst keyAEClassID "clID")
- (defconst keyAEColor "kclr")
- (defconst keyAEColorTable "kcls")
- (defconst keyAECurveHeight "kchd")
- (defconst keyAECurveWidth "kcwd")
- (defconst keyAEDashStyle "dsty")
- (defconst keyAEData "data")
- (defconst keyAEDefinitionRect "kdef")
- (defconst keyAEDescType "dstp")
- (defconst keyAEDestination "dest")
- (defconst keyAEDoAntiAlias "anta")
- (defconst keyAEDoDithered "gdit")
- (defconst keyAEDoRotate "kdrt")
- (defconst keyAEDoScale "ksca")
- (defconst keyAEDoTranslate "ktra")
- (defconst keyAEEditionFileLoc "eloc")
- (defconst keyAEElements "elms")
- (defconst keyAEEndPoint "kedp")
- (defconst keyAEEventClass "evcl")
- (defconst keyAEEventID "evti")
- (defconst keyAEFile "kfil")
- (defconst keyAEFileType "fltp")
- (defconst keyAEFillColor "kfcl")
- (defconst keyAEFillPattern "kfpt")
- (defconst keyAEFlipHorizontal "kfho")
- (defconst keyAEFlipVertical "kfvt")
- (defconst keyAEFont "kfnt")
- (defconst keyAEFormula "kfla")
- (defconst keyAEGraphicObjects "kgrs")
- (defconst keyAEImageQuality "gqua")
- (defconst keyAEInsertHere "insh")
- (defconst keyAEKeyForms "keyf")
- (defconst keyAEKeyword "kywd")
- (defconst keyAELineArrow "lnar")
- (defconst keyAEName "knam")
- (defconst keyAENewElementLoc "knel")
- (defconst keyAEObject "kobj")
- (defconst keyAEObjectClass "kocl")
- (defconst keyAEOffStyles "ofst")
- (defconst keyAEOnStyles "onst")
- (defconst keyAEParameters "prms")
- (defconst keyAEParamFlags "pmfg")
- (defconst keyAEPenColor "kpcl")
- (defconst keyAEPenPattern "kpat")
- (defconst keyAEPenWidth "kpwd")
- (defconst keyAEPixelDepth "kpdp")
- (defconst keyAEPixMapMinus "kpmm")
- (defconst keyAEPMTable "kpmt")
- (defconst keyAEPointList "kpts")
- (defconst keyAEPointSize "kptz")
- (defconst keyAEPosition "kpos")
- (defconst keyAEPropData "prdt")
- (defconst keyAEProperties "qpro")
- (defconst keyAEProperty "kprp")
- (defconst keyAEPropFlags "prfg")
- (defconst keyAEPropID "prop")
- (defconst keyAEProtection "kptc")
- (defconst keyAERenderAs "kren")
- (defconst keyAERequestedType "rtyp")
- (defconst keyAEResult "----")
- (defconst keyAEResultInfo "rsin")
- (defconst keyAERotation "krot")
- (defconst keyAERotPoint "krtp")
- (defconst keyAERowList "krls")
- (defconst keyAESaveOptions "savo")
- (defconst keyAEScale "kscl")
- (defconst keyAEScriptTag "kStg")
- (defconst keyAEShowWhere "show")
- (defconst keyAEStartAngle "ksta")
- (defconst keyAEStartPoint "kstr")
- (defconst keyAEStyles "ksty")
- (defconst keyAEText "ktxt")
- (defconst keyAETextColor "ktxc")
- (defconst keyAETextFont "ktxf")
- (defconst keyAETextPointSize "ktps")
- (defconst keyAETextStyles "txts")
- (defconst keyAETheText "thtx")
- (defconst keyAETransferMode "ktrn")
- (defconst keyAETranslation "ktrl")
- (defconst keyAETryAsStructGraf "toog")
- (defconst keyAEUniformStyles "unis")
- (defconst keyAEUpdateOn "kupd")
- (defconst keyAEUserTerm "utrm")
- (defconst keyAEWindow "wndw")
- (defconst keyAEWritingCode "wrcd")
- (defconst keyMiscellaneous "fmsc")
- (defconst keySelection "fsel")
- (defconst keyWindow "kwnd")
- (defconst pArcAngle "parc")
- (defconst pBackgroundColor "pbcl")
- (defconst pBackgroundPattern "pbpt")
- (defconst pBestType "pbst")
- (defconst pBounds "pbnd")
- (defconst pClass "pcls")
- (defconst pClipboard "pcli")
- (defconst pColor "colr")
- (defconst pColorTable "cltb")
- (defconst pCornerCurveHeight "pchd")
- (defconst pCornerCurveWidth "pcwd")
- (defconst pDashStyle "pdst")
- (defconst pDefaultType "deft")
- (defconst pDefinitionRect "pdrt")
- (defconst pEnabled "enbl")
- (defconst pEndPoint "pend")
- (defconst pFillColor "flcl")
- (defconst pFillPattern "flpt")
- (defconst pFont "font")
- (defconst pFormula "pfor")
- (defconst pGraphicObjects "gobs")
- (defconst pHasCloseBox "hclb")
- (defconst pHasTitleBar "ptit")
- (defconst pIndex "pidx")
- (defconst pInsertionLoc "pins")
- (defconst pIsFloating "isfl")
- (defconst pIsFrontProcess "pisf")
- (defconst pIsModal "pmod")
- (defconst pIsModified "imod")
- (defconst pIsResizable "prsz")
- (defconst pIsStationeryPad "pspd")
- (defconst pIsZoomable "iszm")
- (defconst pIsZoomed "pzum")
- (defconst pItemNumber "itmn")
- (defconst pJustification "pjst")
- (defconst pLineArrow "arro")
- (defconst pMenuID "mnid")
- (defconst pName "pnam")
- (defconst pNewElementLoc "pnel")
- (defconst pPenColor "ppcl")
- (defconst pPenPattern "pppa")
- (defconst pPenWidth "ppwd")
- (defconst pPixelDepth "pdpt")
- (defconst pPointList "ptlt")
- (defconst pPointSize "ptsz")
- (defconst pProtection "ppro")
- (defconst pRotation "prot")
- (defconst pScale "pscl")
- (defconst pScriptTag "psct")
- (defconst pSelection "sele")
- (defconst pStartAngle "pang")
- (defconst pStartPoint "pstp")
- (defconst pTextColor "ptxc")
- (defconst pTextFont "ptxf")
- (defconst pTextItemDelimiters "txdl")
- (defconst pTextPointSize "ptps")
- (defconst pTextStyles "txst")
- (defconst pTransferMode "pptm")
- (defconst pTranslation "ptrs")
- (defconst pUniformStyles "ustl")
- (defconst pUpdateOn "pupd")
- (defconst pUserSelection "pusl")
- (defconst pVersion "vers")
- (defconst pVisible "pvis")
- (defconst typeAEText "tTXT")
- (defconst typeAppleEvent "AEVT")
- (defconst typeArc "tarc")
- (defconst typeBest "best")
- (defconst typeCell "cell")
- (defconst typeClassInfo "clin")
- (defconst typeColorTable "clrt")
- (defconst typeColumn "colm")
- (defconst typeDashStyle "tdas")
- (defconst typeData "tdta")
- (defconst typeDrawingArea "tdar")
- (defconst typeElemInfo "elin")
- (defconst typeEPS "EPS ")
- (defconst typeEventInfo "evin")
- (defconst typeFinderWindow "fwin")
- (defconst typeFixed "fixd")
- (defconst typeGraphicLine "tgln")
- (defconst typeGraphicText "gtxt")
- (defconst typeGroupedGraphic "tgru")
- (defconst typeInsertionLoc "insl")
- (defconst typeIntlText "itxt")
- (defconst typeIntlWritingCode "intl")
- (defconst typeOval "tovl")
- (defconst typeParamInfo "pmin")
- (defconst typePict "PICT")
- (defconst typePixelMap "tpix")
- (defconst typePixMapMinus "tpmm")
- (defconst typePolygon "tpol")
- (defconst typePropInfo "pinf")
- (defconst typeQDPoint "QDpt")
- (defconst typeQDRectangle "qdrt")
- (defconst typeRectangle "rcte")
- (defconst typeRGB16 "tr16")
- (defconst typeRGB96 "tr96")
- (defconst typeRGBColor "RGB ")
- (defconst typeRotation "trot")
- (defconst typeRoundedRectangle "trdr")
- (defconst typeRow "row ")
- (defconst typeScrapStyles "styl")
- (defconst typeStyledText "STXT")
- (defconst typeTable "tabl")
- (defconst typeTextStyles "tsty")
- (defconst typeTIFF "TIFF")
- (defconst zoomIn 7)
- (defconst zoomOut 8)
-
- ;;;
- ;;; *** From AEObjects.h ***
- ;;;
-
- (defconst kAEAND "AND ")
- (defconst kAEOR "OR ")
- (defconst kAENOT "NOT ")
- (defconst kAEFirst "firs")
- (defconst kAELast "last")
- (defconst kAEMiddle "midd")
- (defconst kAEAny "any ")
- (defconst kAEAll "all ")
- (defconst kAENext "next")
- (defconst kAEPrevious "prev")
- (defconst keyAEDesiredClass "want")
- (defconst keyAEContainer "from")
- (defconst keyAEKeyForm "form")
- (defconst keyAEKeyData "seld")
- (defconst keyAERangeStart "star")
- (defconst keyAERangeStop "stop")
- (defconst formAbsolutePosition "indx")
- (defconst formRelativePosition "rele")
- (defconst formTest "test")
- (defconst formRange "rang")
- (defconst formPropertyID "prop")
- (defconst formName "name")
- (defconst typeObjectSpecifier "obj ")
- (defconst typeObjectBeingExamined "exmn")
- (defconst typeCurrentContainer "ccnt")
- (defconst typeToken "toke")
- (defconst typeRelativeDescriptor "rel ")
- (defconst typeAbsoluteOrdinal "abso")
- (defconst typeIndexDescriptor "inde")
- (defconst typeRangeDescriptor "rang")
- (defconst typeLogicalDescriptor "logi")
- (defconst typeCompDescriptor "cmpd")
- (defconst keyAECompOperator "relo")
- (defconst keyAELogicalTerms "term")
- (defconst keyAELogicalOperator "logc")
- (defconst keyAEObject1 "obj1")
- (defconst keyAEObject2 "obj2")
- (defconst keyDisposeTokenProc "xtok")
- (defconst keyAECompareProc "cmpr")
- (defconst keyAECountProc "cont")
- (defconst keyAEMarkTokenProc "mkid")
- (defconst keyAEMarkProc "mark")
- (defconst keyAEAdjustMarksProc "adjm")
- (defconst keyAEGetErrDescProc "indc")
-
- (defconst errAEImpossibleRange -1720)
- (defconst errAEWrongNumberArgs -1721)
- (defconst errAEAccessorNotFound -1723)
- (defconst errAENoSuchLogical -1725)
- (defconst errAEBadTestKey -1726)
- (defconst errAENotAnObjSpec -1727)
- (defconst errAENoSuchObject -1728 "no such object")
- (defconst errAENegativeCount -1729)
- (defconst errAEEmptyListContainer -1730)
-
- (defconst kAEIDoMinimum 0)
- (defconst kAEIDoWhose 1)
- (defconst kAEIDoMarking 4)
-
- (defconst typeWhoseDescriptor "whos")
- (defconst formWhose "whos")
- (defconst typeWhoseRange "wrng")
- (defconst keyAEWhoseRangeStart "wstr")
- (defconst keyAEWhoseRangeStop "wstp")
- (defconst keyAEIndex "kidx")
- (defconst keyAETest "ktst")
-
- ;;;
- ;;; Other constants
- ;;;
-
- (defconst sizeof-char 1)
- (defconst sizeof-short 2)
- (defconst sizeof-long 4)
- (defconst sizeof-int 4)
- (defconst sizeof-FSSpec 70)
- (defconst sizeof-AEDesc 8)
- (defconst sizeof-AEDescList 8)
- (defconst sizeof-AERecord 8)
- (defconst sizeof-AppleEvent 8)
- (defconst sizeof-FInfo 16)
-
- (defun hex-string-to-int (string)
- (if (zerop (length string))
- 0
- (let* ((c (string-to-char (substring string -1)))
- (place (cond
- ((and (>= c (string-to-char "0")) (<= c (string-to-char "9")))
- (- c (string-to-char "0")))
- ((and (>= c (string-to-char "a")) (<= c (string-to-char "f")))
- (+ 10 (- c (string-to-char "a"))))
- ((and (>= c (string-to-char "A")) (<= c (string-to-char "F")))
- (+ 10 (- c (string-to-char "A"))))
- (t
- 0))))
- (+ place (* 16 (hex-string-to-int (substring string 0 -1)))))))
-
- (defun ae-encode (base offset type data)
- (cond
- ((equal type "string")
- (let ((i 0)
- (n (length data)))
- (while (< i n)
- (encode-internal base (+ offset i) sizeof-char
- (extract-internal data i sizeof-char nil) nil)
- (setq i (1+ i))))
- base)
- ((equal type typeBoolean)
- (encode-internal base offset sizeof-char
- (if (stringp data) (hex-string-to-int data) data)
- nil)
- base)
- ((equal type typeShortInteger)
- (encode-internal base offset sizeof-short
- (if (stringp data) (hex-string-to-int data) data)
- nil)
- base)
- ((equal type typeLongInteger)
- (encode-internal base offset sizeof-long
- (if (stringp data) (hex-string-to-int data) data)
- nil)
- base)
- ((equal type "lisp-object")
- (encode-internal base offset sizeof-long data nil)
- base)
- (t
- nil)))
-
- (defun ae-encode-long-integer (i)
- (ae-encode (make-string 4 0) 0 typeLongInteger i))
-
- (defun ae-extract (type data offset &optional length)
- (cond
- ((equal type typeBoolean)
- (not (zerop (extract-internal data offset 1 nil))))
- ((equal type typeShortInteger)
- (extract-internal data offset sizeof-short t))
- ((equal type typeLongInteger)
- (extract-internal data offset sizeof-long t))
- ((equal type "char")
- (extract-internal data offset sizeof-char nil))
- ((equal type "string")
- (let ((result (make-string length 0))
- (i 0))
- (while (< i length)
- (encode-internal result i sizeof-char
- (extract-internal data (+ offset i) sizeof-char nil) nil)
- (setq i (1+ i)))
- result))
- ((equal type "pascal-string")
- (let ((length (extract-internal data offset sizeof-char nil)))
- (ae-extract "string" data (1+ offset) length)))
- ((equal type typeFSS)
- (ae-extract "string" data offset sizeof-FSSpec))
- (t
- nil)))
-
- (defun PtoCstr (s)
- (let* ((n (extract-internal s 0 1 nil)))
- (substring s 1 (1+ n))))
-
- (defun CtoPstr (s)
- (let* ((n (length s))
- (m (if (> n 255) 255 n))
- (u (concat " " s)))
- (encode-internal u 0 1 m nil)
- u))
-
- (defvar documented-error-list
- (mapcar (function (lambda (x) (cons (eval x) x)))
- '(nsvErr fnfErr connectionInvalid errAEEventNotHandled
- errAENoSuchObject errAEDescNotFound errAENoUserInteraction)))
-
- (defun lookup-error-string (err)
- (let ((match (assoc err documented-error-list)))
- (if match
- (get (cdr match) 'variable-documentation)
- nil)))
-
- (provide 'mac-headers)
-